#pragma once
#include "ASN1Encodable.h"
#include "ASN1Sequence.h"
#include "ASN1ObjectIdentifier.h"
#include "ASN1Bool.h"
#include "ASN1OctectString.h"

namespace AppliedCryptography
{
	class Extensions : public ASN1Encodable
	{
	private:
		ASN1Sequence _value;
		std::vector<ASN1Sequence*> _extensions;

	protected:
		Extensions(ClassBits classBits, ConstructedBit constucted, TypeNumberBits number);

	public:
		Extensions();
		Extensions(Extensions& other);
		virtual ~Extensions();

	public:
		virtual Extensions& add(ASN1ObjectIdentifier& extnid, ASN1Bool& critical, ASN1OctectString& extnValue);
		virtual Extensions& flush();
		virtual unsigned int size() const;
		virtual ASN1ObjectIdentifier& getExtensionOID(unsigned int index) const;
		virtual ASN1Bool& getExtensionCritical(unsigned int index) const;
		virtual ASN1OctectString& getExtensionValue(unsigned int index) const;
		virtual std::vector<byte> getContentBits() const;
		virtual Extensions& operator=(const Extensions& other);

	public:
		static ASN1ObjectIdentifier BasicConstraintsOID;
	};
}; // namespace AppliedCryptography
